﻿using HDFSViewer.Component;
using Microsoft.Practices.Prism.Commands;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HDFSViewer.ViewModel
{
    public class AddFileWindowVM : NotifyObject
    {
        public string DirectoryPath { get; set; }
        public string SelectedEncoding { get; set; }
        public string Content { get; set; }
        public string Name { get; set; }

        public bool NameIsReadonly { get; set; }

        public DelegateCommand Save { get; set; }

        public AddFileWindowVM(string path, string name, bool nameIsReadonly)
        {
            SelectedEncoding = "UTF8";
            DirectoryPath = path;
            Name = name;
            Content = string.Empty;
            NameIsReadonly = nameIsReadonly;
        }

        private void DoSave()
        {
        }

        private bool DoCanSave()
        {
            return !string.IsNullOrWhiteSpace(Name);
        }
    }
}
